package com.damai.utils;

import java.io.File;

public class Scans {

	private static Scans scanner = new Scans();
	
	public static Scans me(){
		return scanner;
	}
	
	/**
	 * 扫描一个目录的所有文件
	 * @param dir
	 * @param fileFilter
	 */
	public void scan(File dir,FileVisitor visitor){
		File[] files = dir.listFiles();
		if(files==null){
			return;
		}
		
		for (File file : files) {
			visitor.visitFile(file);
			if(file.isDirectory()){
				scan(file, visitor);
			}
		}
	}
	
	
}
